public class Item
{
    /// <summary>
    /// 获取物品编号
    /// </summary>
    /// <returns>物品编号</returns>
    public extern int? api_get_key();

    /// <summary>
    /// 设置物品名称
    /// </summary>
    /// <param name="name"> 物品名称 </param>
    /// <returns></returns>
    public extern void set_name(string name);

    /// <summary>
    /// 获取物品名称
    /// </summary>
    /// <returns>物品名称</returns>
    public extern string get_name();

    /// <summary>
    /// 获取物品配置名称
    /// </summary>
    /// <returns>物品名称</returns>
    public extern string api_get_conf_name();

    /// <summary>
    /// 设置物品描述
    /// </summary>
    /// <param name="desc"> 物品描述 </param>
    /// <returns></returns>
    public extern void api_set_desc(string desc);

    /// <summary>
    /// 获取物品描述
    /// </summary>
    /// <returns>物品描述</returns>
    public extern string api_get_desc();

    /// <summary>
    /// 获取物品配置描述
    /// </summary>
    /// <returns>物品描述</returns>
    public extern string api_get_conf_desc();

    /// <summary>
    /// 获取物品类型
    /// </summary>
    /// <returns>物品类型</returns>
    public extern int? api_get_type();

    /// <summary>
    /// 获取物品等级
    /// </summary>
    /// <returns>物品等级</returns>
    public extern int? api_get_level();

    /// <summary>
    /// 设置物品等级
    /// </summary>
    /// <param name="level"> 等级 </param>
    /// <returns></returns>
    public extern void api_set_level(int? level);

    /// <summary>
    /// 丢弃物品
    /// </summary>
    /// <param name="pos"> 点 </param>
    /// <param name="stack_cnt"> 数量 </param>
    /// <returns></returns>
    public extern void api_drop_self(Point pos,int? stack_cnt);

    /// <summary>
    /// 从单位身上移除物品
    /// </summary>
    /// <returns></returns>
    public extern void api_remove();

    /// <summary>
    /// 设置物品出售
    /// </summary>
    /// <param name="sale_state"> 可否出售 </param>
    /// <returns></returns>
    public extern void api_set_sale_state(bool? sale_state);

    /// <summary>
    /// 设置物品堆叠数
    /// </summary>
    /// <param name="stack_cnt"> 堆叠数 </param>
    /// <returns></returns>
    public extern void api_set_stack_cnt(int? stack_cnt);

    /// <summary>
    /// 设置物品充能数
    /// </summary>
    /// <param name="charge_cnt"> 充能数 </param>
    /// <returns></returns>
    public extern void api_set_charge_cnt(int? charge_cnt);

    /// <summary>
    /// 设置物品最大充能数
    /// </summary>
    /// <param name="max_charge"> 最大充能数 </param>
    /// <returns></returns>
    public extern void api_set_max_charge(int? max_charge);

    /// <summary>
    /// 物品实体所在位置(若在玩家身上返回玩家位置)
    /// </summary>
    /// <returns>物品位置</returns>
    public extern Point api_get_position();

    /// <summary>
    /// 物品是否在场景中
    /// </summary>
    /// <returns>是否在场景中</returns>
    public extern bool? api_is_in_scene();

    /// <summary>
    /// 获取物品堆叠数
    /// </summary>
    /// <returns>堆叠数</returns>
    public extern int? api_get_stack_cnt();

    /// <summary>
    /// 获取物品堆叠类型
    /// </summary>
    /// <returns>堆叠类型</returns>
    public extern int? api_get_stack_type();

    /// <summary>
    /// 获取物品充能数
    /// </summary>
    /// <returns>充能数</returns>
    public extern int? api_get_charge_cnt();

    /// <summary>
    /// 获取物品充能数
    /// </summary>
    /// <returns>最大充能数</returns>
    public extern int? api_get_max_charge();

    /// <summary>
    /// 设置物品丢弃
    /// </summary>
    /// <param name="can_drop"> 可否丢弃 </param>
    /// <returns></returns>
    public extern void api_set_droppable(bool? can_drop);

    /// <summary>
    /// 设置物品出售
    /// </summary>
    /// <param name="can_sell"> 可否丢弃 </param>
    /// <returns></returns>
    public extern void api_set_sellable(bool? can_sell);

    /// <summary>
    /// 设置物品生命值
    /// </summary>
    /// <param name="hp"> 生命值 </param>
    /// <returns></returns>
    public extern void api_set_hp(double? hp);

    /// <summary>
    /// 获取物品丢弃
    /// </summary>
    /// <returns>可否丢弃</returns>
    public extern bool? api_get_droppable();

    /// <summary>
    /// 获取物品出售
    /// </summary>
    /// <returns>可否出售</returns>
    public extern bool? api_get_sellable();

    /// <summary>
    /// 获取物品生命值
    /// </summary>
    /// <returns>生命值</returns>
    public extern Fix32 api_get_hp();

    /// <summary>
    /// 设置物品附加属性
    /// </summary>
    /// <param name="attr_element_field"> 属性名 </param>
    /// <param name="attr_key"> 属性成分名 </param>
    /// <param name="val"> 属性值 </param>
    /// <returns></returns>
    public extern void api_set_attr(string attr_element_field,string attr_key,double? val);

    /// <summary>
    /// 增加物品附加属性
    /// </summary>
    /// <param name="attr_element_field"> 属性名 </param>
    /// <param name="attr_key"> 属性成分名 </param>
    /// <param name="delta"> 属性值 </param>
    /// <returns></returns>
    public extern void api_change_attr(string attr_element_field,string attr_key,double? delta);

    /// <summary>
    /// 获取物品附加属性
    /// </summary>
    /// <param name="attr_element_field"> 属性成分名 </param>
    /// <param name="attr_key"> 属性名 </param>
    /// <returns>属性值</returns>
    public extern Fix32 api_get_attr(string attr_element_field,string attr_key);

    /// <summary>
    /// 设置物品所有者
    /// </summary>
    /// <param name="creator"> 所有者 </param>
    /// <returns></returns>
    public extern void api_set_creator(Role creator);

    /// <summary>
    /// 获得物品所有者
    /// </summary>
    /// <returns>所有者</returns>
    public extern Role api_get_creator();

    /// <summary>
    /// 获得物品拥有者
    /// </summary>
    /// <returns>拥有者</returns>
    public extern Unit api_get_owner();

    /// <summary>
    /// 添加物品堆叠数
    /// </summary>
    /// <param name="cnt"> 堆叠数 </param>
    /// <returns></returns>
    public extern void api_add_stack(int? cnt);

    /// <summary>
    /// 添加物品充能数
    /// </summary>
    /// <param name="cnt"> 充能数 </param>
    /// <returns></returns>
    public extern void api_add_charge(int? cnt);

    /// <summary>
    /// 获取物品缩放
    /// </summary>
    /// <returns>缩放</returns>
    public extern Fix32 api_get_scale();

    /// <summary>
    /// 获取物品朝向
    /// </summary>
    /// <returns>朝向角度</returns>
    public extern Fix32 api_get_face_angle();

    /// <summary>
    /// 设置物品缩放
    /// </summary>
    /// <param name="scale"> 缩放 </param>
    /// <returns></returns>
    public extern void api_set_scale(double? scale);

    /// <summary>
    /// 设置物品位置
    /// </summary>
    /// <param name="point"> 物品位置 </param>
    /// <returns></returns>
    public extern void api_set_position(Point point);

    /// <summary>
    /// 设置物品朝向
    /// </summary>
    /// <param name="face_angle"> 物品朝向 </param>
    /// <returns></returns>
    public extern void api_set_face_angle(double? face_angle);

    /// <summary>
    /// 是否在区域内
    /// </summary>
    /// <param name="area"> 区域 </param>
    /// <returns>是否在区域</returns>
    public extern bool? api_is_in_area(Area area);

    /// <summary>
    /// 移动物品到点
    /// </summary>
    /// <param name="point"> 点 </param>
    /// <returns></returns>
    public extern void api_transmit(Point point);

    /// <summary>
    /// 物品添加标签
    /// </summary>
    /// <param name="tag"> 标签 </param>
    /// <returns></returns>
    public extern void api_add_tag(string tag);

    /// <summary>
    /// 物品删除标签
    /// </summary>
    /// <param name="tag"> 标签 </param>
    /// <returns></returns>
    public extern void api_remove_tag(string tag);

    /// <summary>
    /// 物品是否拥有标签
    /// </summary>
    /// <param name="tag"> 标签 </param>
    /// <returns>物品是否拥有标签</returns>
    public extern bool? api_has_tag(string tag);

    /// <summary>
    /// 物品移除键值对
    /// </summary>
    /// <param name="k"> 要移除的键 </param>
    /// <returns></returns>
    public extern void api_remove_kv(string k);

    /// <summary>
    /// 获取物品在场景中的对应实体
    /// </summary>
    /// <returns>场景中的实体</returns>
    public extern Unit api_get_item_unit();

    /// <summary>
    /// 获取物品id
    /// </summary>
    /// <returns>物品id</returns>
    public extern int? api_get_id();

    /// <summary>
    /// 物品是否在物品栏
    /// </summary>
    /// <returns>是否在物品栏中</returns>
    public extern bool? api_is_in_bar();

    /// <summary>
    /// 物品是否在背包栏中
    /// </summary>
    /// <returns>是否在背包栏中</returns>
    public extern bool? api_is_in_pkg();

    /// <summary>
    /// 对物品所属单位的所属玩家关系播放音乐
    /// </summary>
    /// <param name="camp_target"> 玩家关系 </param>
    /// <param name="sid"> 乐曲编号 </param>
    /// <param name="loop"> 是否循环 </param>
    /// <returns></returns>
    public extern void api_play_sound_by_item_for_role_relation(int? camp_target,int? sid,bool? loop);

    /// <summary>
    /// 获取物品的主动技能
    /// </summary>
    /// <returns>技能对象</returns>
    public extern Ability api_get_positive_ability();

    /// <summary>
    /// 获取物品的被动技能
    /// </summary>
    /// <param name="index"> 索引 </param>
    /// <returns>技能对象</returns>
    public extern Ability api_get_passive_ability(int? index);

    /// <summary>
    /// 设置物品的图标为图片
    /// </summary>
    /// <param name="icon_id"> 图标 </param>
    /// <returns></returns>
    public extern void api_set_item_icon(int? icon_id);

    /// <summary>
    /// 获取物品的图标
    /// </summary>
    /// <returns>图标</returns>
    public extern int? api_get_item_icon();

    /// <summary>
    /// 物品所在背包槽位类型
    /// </summary>
    /// <returns>槽位类型</returns>
    public extern int? api_get_item_slot_type();

    /// <summary>
    /// 物品所在的格子位置索引
    /// </summary>
    /// <returns>格子位置</returns>
    public extern int? api_get_item_slot_idx();

    /// <summary>
    /// 物品实例添加被动技能
    /// </summary>
    /// <param name="ability_id"> 技能id </param>
    /// <param name="ability_level"> 技能等级 </param>
    /// <returns></returns>
    public extern void api_item_add_passive_ability(int? ability_id,int? ability_level);

    /// <summary>
    /// 获取物品的模型
    /// </summary>
    /// <returns>模型编号</returns>
    public extern int? api_get_item_model();

    /// <summary>
    /// 设置物品可见性
    /// </summary>
    /// <param name="is_visible"> 是否可见 </param>
    /// <returns></returns>
    public extern void api_set_item_visible(bool? is_visible);

    /// <summary>
    /// 物品是否可见
    /// </summary>
    /// <returns>是否可见</returns>
    public extern bool? api_is_item_visible();

    /// <summary>
    /// 物品替换模型
    /// </summary>
    /// <param name="source_model"> 原模型编号 </param>
    /// <returns></returns>
    public extern void api_change_model(int? source_model);

    /// <summary>
    /// 取消物品替换模型
    /// </summary>
    /// <param name="target_model"> 目标模型名字 </param>
    /// <returns></returns>
    public extern void api_cancel_replace_model(int? target_model);

    /// <summary>
    /// 获取物品购买所需资源
    /// </summary>
    /// <param name="role_res_key"> 玩家属性key </param>
    /// <returns>所需资源数量</returns>
    public extern int? api_get_item_res_cnt(string role_res_key);

    /// <summary>
    /// 获取物品的实数属性
    /// </summary>
    /// <param name="att_key"> 物品实数属性key </param>
    /// <returns>实数属性值</returns>
    public extern Fix32 api_get_item_float_attr(string att_key);

    /// <summary>
    /// 获取物品的整数属性
    /// </summary>
    /// <param name="att_key"> 物品整数属性key </param>
    /// <returns>整数属性值</returns>
    public extern int? api_get_item_int_attr(string att_key);

    /// <summary>
    /// 物品是否自动使用
    /// </summary>
    /// <returns>是否自动使用</returns>
    public extern bool? api_is_item_auto_use();

}
